package com.lc1993929.redis;

import com.lc1993929.redis.util.RedisCacheUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by LiuChang on 2017/3/30.
 */
public class TestRedis {
    @Autowired
    private RedisCacheUtil<User> redisCacheUtil;

    @RequestMapping("testGetCache")
    public void testGetCache() {
 /*Map<String,Country> countryMap = redisCacheUtil1.getCacheMap("country");
 Map<String,City> cityMap = redisCacheUtil.getCacheMap("city");*/
        Map<Integer, Country> countryMap = redisCacheUtil.getCacheIntegerMap("countryMap");
        Map<Integer, City> cityMap = redisCacheUtil.getCacheIntegerMap("cityMap");

        for (int key : countryMap.keySet()) {
            System.out.println("key = " + key + ",value=" + countryMap.get(key));
        }

        System.out.println("------------city");
        for (int key : cityMap.keySet()) {
            System.out.println("key = " + key + ",value=" + cityMap.get(key));
        }
    }
}
